When developing source code for a software program, such as in a text editor of an Integrated Development Environment (IDE), a developer may suspect that some portion(s) of the code are faulty (i.e., likely contain something that causes a certain error which prevents the program from executing properly). In such instances, the developer will typically utilize a commenting feature of the IDE to comment out the lines or blocks of code that are believed to be causing the problem. Commenting out the suspected faulty code fragments prevents those code fragments from being run when the IDE attempts to execute the program. This way, a developer can comment out the portion of the code he or she believes is faulty and test the remaining code by allowing the IDE to execute the program running only the remaining code. If the remaining code runs properly, the developer may ascertain that the error was caused by some portion of the commented out code, which the developer can fix at a later time. Once the commented out, faulty code is fixed, the developer can uncomment the previously faulty code, thereby allowing it to be run with the remaining code of the program.
Typically, a line or block of code is commented out by adding the required commenting characters to each line or block of code which the developer wants commented out. For example, in order to comment out a line of code in JAVA, a developer may add // at the beginning of the line. When commenting out a block of code, a developer may bracket the block of code with /* */. Possibly, there may be a number of related, faulty code fragments within a program that may be responsible for causing the same error(s). Further, these faulty code fragments may be scattered (i.e., non-adjacent) throughout the program text. For every non-adjacent line or block of code which the developer wants to comment out, currently he or she is typically required to go through manually and add the above-referenced characters to each line or block. Further, if the developer is able to fix the commented-out code, he or she may then wish to uncomment the code, so that it may be run with the remaining code when executing the program. Uncommenting code currently requires manual removal of the above-referenced characters from each line or block of code. If there are a large number of non-contiguous lines or blocks of faulty code which is related (ex.—responsible for causing the same error(s)), a developer may have to spend a significant amount of time locating and manually entering/removing the above-referenced commenting characters from the code in order to comment/uncomment each line or block of the faulty code. The time inefficiency is compounded if the program is being worked on by different developers of a development team at different times. For instance, when one of the developers wants to make edits to try and fix the faulty code fragments, he or she may be required to locate all of the related, faulty code fragments and manually comment out/edit/uncomment each one.
Therefore, it may be desirable to have a system and method for manipulating source code in a text editor of an Integrated Development Environment (IDE) which addresses the above-referenced problems and limitations of the conventional solutions.